import { uniRequset } from '@/utils/request'
import type { ProductType } from '@/types/home'
import type { addressType } from '@/types/productDetai'
export const getProductDetailAPI = (id: number) => {
  return uniRequset<ProductType>({
    url: `/goods/product/get_product_detail/${id}`,
    method: 'GET',
  })
}

export const getAddressListAPI = () => {
  return uniRequset<addressType[]>({
    url: '/address/get_address_list',
    method: 'GET',
  })
}
export const getCategoryProductListAPI = (page: number, category_id: number) => {
  return uniRequset<ProductType[]>({
    url: '/goods/product/get_category_goods',
    method: 'GET',
    data: { category_id: category_id, page: page },
  })
}
